local skel = fk.CreateSkill {
  name = "emo__anqu",
  tags = {Skill.Switch},
}

Fk:loadTranslationTable{
  ["emo__anqu"] = "暗取",
  [":emo__anqu"] = "转换技，出牌阶段，阳：你可以将一张黑色牌当【瞒天过海】使用；阴：你可以将一张红色牌当【顺手牵羊】使用。",

  [":emo__anqu_yang"] = "转换技，出牌阶段，<font color='#E0DB2F'>阳：你可以将一张黑色牌当【瞒天过海】使用；</font>阴：你可以将一张红色牌当【顺手牵羊】使用。",
  [":emo__anqu_yin"] = "转换技，出牌阶段，阳：你可以将一张黑色牌当【瞒天过海】使用；<font color='#E0DB2F'>阴：你可以将一张红色牌当【顺手牵羊】使用。</font>",

  ["#emo__anqu-yang"] = "暗取:将1张黑色牌当【瞒天过海】使用",
  ["#emo__anqu-yin"] = "暗取:将1张红色牌当【顺手牵羊】使用",
}

skel:addEffect("viewas", {
  anim_type = "control",
  pattern = "snatch,underhanding",
  prompt = function(self, player)
    return "#emo__anqu-"..player:getSwitchSkillState(skel.name, false, true)
  end,
  handly_pile = true,
  filter_pattern = function (self, player, card_name)
    return {
      max_num = 1,
      min_num = 1,
      pattern = (player:getSwitchSkillState(skel.name) == fk.SwitchYang) and ".|.|black" or ".|.|red",
    }
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard(player:getSwitchSkillState(skel.name) == fk.SwitchYang and "underhanding" or "snatch")
    card.skillName = skel.name
    card:addSubcard(cards[1])
    return card
  end,
  enabled_at_play = Util.TrueFunc,
  enabled_at_response = Util.FalseFunc,
})

return skel
